﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Mail_Management : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //sHow All data for GirdView
        gvMail.DataSourceID = "SqlDataSource2";
    }
    protected void gvMail_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        //Go to Details page
        if (e.CommandName == "Details")
        {
            string MailID = Convert.ToString(e.CommandArgument);
            Response.Redirect("Mail_Details.aspx?MailID=" + MailID);
        }

    }
    protected void imgbShowAll_Click(object sender, ImageClickEventArgs e)
    {
        //sHow All data for GirdView
        gvMail.DataSourceID = "SqlDataSource2";
    }
    protected void imgbSearch_Click(object sender, ImageClickEventArgs e)
    {
        gvMail.DataSourceID = "SqlDataSource1";
    }
}